<?php
/**
 * QQAS - share your knowledge to the world!
 *
 * @author		xiaochong0302 <xiaochong0302@gmail.com>
 * @copyright	Copyright (c) 2011, Koogua Studio.
 * @license		http://www.qqas.org/user_guide/license.html
 * @link		http://www.qqas.org
 * @since		Version 1.0
 * @filesource
 */


class FaqAction extends HomeAction
{

    protected $Faq;


    function _initialize()
	{
		parent::_initialize();
		$this->Faq = D('Faq');
	}


	public function index()
    {
        $map = array();
    	$order = array('display_order' => 'asc');
    	$faqs  = $this->Faq->where($map)->order($order)->select();

    	$this->assign('faqs', $faqs);
    	$this->display();
    }


    public function details()
    {
    	$faqID = intval($_GET['fid']);
    	$faq = $this->Faq->find($faqID);
    	if (!$faq)
    	{
    		$this->error(L('faq_not_existed'));
    	}

    	$this->assign('faq', $faq);
    	$this->display();
    }

}

/* End of file FaqAction.class.php */
/* Location: ./App/Lib/Action/Home/FaqAction.class.php */
